import {
  h
} from 'vue'
import tableRank from "@/components/tableRank.vue";
import videoBac from './component/videoBac.vue'
import sortImg from '@/assets/layout/sort.png'
export const tableColumnsMap = {
  1: [{
      label: '排名',
      width: '80',
      align: 'center',
      render: (row, columns, index) => {
        return h(tableRank, {
          rank: index + row.size
        })
      }
    },
    {
      label: '投手',
      align: 'center',
      prop: 'username'
    },
    {
      label: '消耗(元)',
      align: 'center',
      prop: 'cost',
      render: row => {
        return h('span', (row.realCost || 0).toFixed(2))
      },
    },
    {
      label: '回收(元)',
      align: 'center',
      prop: 'cost',
      render: row => {
        return h('span', (row.realBrokerage || 0).toFixed(2))
      },
    },
    {
      label: '实时ROI',
      align: 'center',
      prop: 'roi',
      render: row => {
        return h('span', (row.roi || 0) + '%')
      },
      renderHeader: () => {
        return h('div', {
          className: 'tab_header'
        }, ['实时ROI', h('img', {
          src: sortImg
        })])
      }
    },
    // {
    //   label: '书名',
    //   align: 'center',
    //   prop: 'bookName'
    // },
  ],
  2: [{
      label: '排名',
      width: '80',
      align: 'center',
      render: (row, columns, index) => {
        return h(tableRank, {
          rank: index + row.size
        })
      }
    },
    {
      label: '投手',
      align: 'center',
      prop: 'username'
    },
    {
      label: '累计消耗(元)',
      align: 'center',
      prop: 'cost',
      render: row => {
        return h('span', (row.realCost || 0).toFixed(2))
      }
    },
    {
      label: '累计回收(元)',
      align: 'center',
      prop: 'cost',
      render: row => {
        return h('span', (row.realBrokerage || 0).toFixed(2))
      }
    },
    {
      label: '实时ROI',
      align: 'center',
      prop: 'roi',
      render: row => {
        return h('span', (row.roi || 0) + '%')
      },
      renderHeader: () => {
        return h('div', {
          className: 'tab_header'
        }, ['实时ROI', h('img', {
          src: sortImg
        })])
      }
    },
    // {
    //   label: '书名',
    //   align: 'center',
    //   prop: 'bookName'
    // },
  ],
  3: [{
      label: '排名',
      width: '80',
      align: 'center',
      render: (row, columns, index) => {
        return h(tableRank, {
          rank: index + row.size
        })
      }
    },
    {
      label: '投手',
      align: 'center',
      prop: 'username'
    },
    {
      label: '素材',
      align: 'center',
      prop: 'username',
      render: row => {
        return h(videoBac, {
          video: row.vedioDto || {}
        })
      }
    },
    {
      label: '消耗(元)',
      align: 'center',
      render: row => {
        return h('span', (row.realCost || 0).toFixed(2))
      }
    },
    {
      label: '实时ROI',
      align: 'center',
      prop: 'roi',
      render: row => {
        return h('span', (row.roi || 0) + '%')
      },
      renderHeader: () => {
        return h('div', {
          className: 'tab_header'
        }, ['实时ROI', h('img', {
          src: sortImg
        })])
      }
    },
  ],
}
